//
//  UserCell.m
//  NewNest
//
//  Created by 王阳阳 on 16/3/8.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "UserCell.h"

@implementation UserCell
/// 初始化方法
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        //图片
        self.imageview = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageview];
        
        //标题
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_nameLabel];
    }
    return self;
}

/// 布局方法
-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    //图片
    self.imageview.frame = CGRectMake(0, 0, self.contentView.frame.size.width - 40, self.contentView.frame.size.width - 40);
    _imageview.center = CGPointMake(self.contentView.center.x, self.contentView.center.y);
    //字体
    self.nameLabel.frame = CGRectMake(10, _imageview.frame.origin.y + _imageview.frame.size.height + 10, self.contentView.frame.size.width - 20, 15);
    //居中
    _nameLabel.textAlignment = NSTextAlignmentCenter;
    //字体大小
    _nameLabel.font = [UIFont systemFontOfSize:12];
    
}

@end
